// 化学相关的类型定义

export interface IChemistryObject {
  getString(): string;
  getElements(): string[];
  getElementCount(element: string): number;
}

export interface IElement extends IChemistryObject {
  getElementString(): string;
}

export interface IElementPair extends IChemistryObject {
  getElement(): IElement;
  getCount(): number;
}

export interface IElementCombine extends IChemistryObject {
  append(pair: IElementPair): void;
}

export interface IMolecularFormula extends IChemistryObject {
  append(pair: IElementCombinePair): void;
}

export interface IElementCombinePair extends IChemistryObject {
  getCombine(): IElementCombine;
  getCount(): number;
}

export interface IEquationPosition {
  getMolecularFormula(): IMolecularFormula;
  setCount(count: number): void;
  getCount(): number;
  getString(): string;
  getElements(): string[];
  getElementCount(element: string): number;
}

export interface IEquation {
  appendLeft(position: IEquationPosition): void;
  appendRight(position: IEquationPosition): void;
  balance(): boolean;
  print(): string;
}

// 平衡结果接口
export interface BalanceResult {
  success: boolean;
  equation?: string;
  leftCoeffs?: number[];
  rightCoeffs?: number[];
  message?: string;
}